package com.taobao.api.request;

import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;

import com.taobao.api.response.TmallNrPayDeductResponse;

/**
 * TOP API: tmall.nr.pay.deduct request
 * 
 * @author top auto create
 * @since 1.0, 2018.07.25
 */
public class TmallNrPayDeductRequest extends BaseTaobaoRequest<TmallNrPayDeductResponse> {
	
	

	/** 
	* 业务身份标识
	 */
	private String bizIdentity;

	/** 
	* 买家id
	 */
	private Long buyerId;

	/** 
	* 付款码、卡号等信息,例如支付宝付款码、微信付款码等。
	 */
	private String channelCode;

	/** 
	* 线下支付流水号，用来唯一关联一次线下支付操作
	 */
	private String currentTransactionId;

	/** 
	* 线下收款操作员标识
	 */
	private String operatorId;

	/** 
	* 支付渠道标识，枚举类型包括: 1.	微信支付（wechat_pay） 2.	支付宝支付（alipay） 3.	银联支付（bank_card） 4.	线下储值卡支付（deposit_card） 5.	现金支付（cash）。 6.	其他(other)
	 */
	private String payChannel;

	/** 
	* 线下实付款金额，单位为分，例如订单金额128.07元，抹零后为128.1元，透传的金额为12810。
	 */
	private Long payFee;

	/** 
	* 线下支付操作完成时间，时间格式按照“yyyy-MM-dd HH:mm:ss”格式来输入
	 */
	private String payTime;

	/** 
	* 线下支付抹零金额，单位为分，例如订单金额128.07元，按照四舍五入抹零规则，则抹零金额为增加0.03元，抹零导致实付款变少的场景值为负数。或者由线下门店提前在天猫端配置抹零规则，则该参数无需上传。
	 */
	private Long smallChange;

	/** 
	* 门店编码
	 */
	private String storeCode;

	/** 
	* 线下门店交易单号
	 */
	private String storeOrderId;

	/** 
	* 淘系交易订单号
	 */
	private String tid;

	/** 
	* 收银设备唯一ID（也可以是唯一编号）
	 */
	private String utdid;

	public void setBizIdentity(String bizIdentity) {
		this.bizIdentity = bizIdentity;
	}

	public String getBizIdentity() {
		return this.bizIdentity;
	}

	public void setBuyerId(Long buyerId) {
		this.buyerId = buyerId;
	}

	public Long getBuyerId() {
		return this.buyerId;
	}

	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}

	public String getChannelCode() {
		return this.channelCode;
	}

	public void setCurrentTransactionId(String currentTransactionId) {
		this.currentTransactionId = currentTransactionId;
	}

	public String getCurrentTransactionId() {
		return this.currentTransactionId;
	}

	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}

	public String getOperatorId() {
		return this.operatorId;
	}

	public void setPayChannel(String payChannel) {
		this.payChannel = payChannel;
	}

	public String getPayChannel() {
		return this.payChannel;
	}

	public void setPayFee(Long payFee) {
		this.payFee = payFee;
	}

	public Long getPayFee() {
		return this.payFee;
	}

	public void setPayTime(String payTime) {
		this.payTime = payTime;
	}

	public String getPayTime() {
		return this.payTime;
	}

	public void setSmallChange(Long smallChange) {
		this.smallChange = smallChange;
	}

	public Long getSmallChange() {
		return this.smallChange;
	}

	public void setStoreCode(String storeCode) {
		this.storeCode = storeCode;
	}

	public String getStoreCode() {
		return this.storeCode;
	}

	public void setStoreOrderId(String storeOrderId) {
		this.storeOrderId = storeOrderId;
	}

	public String getStoreOrderId() {
		return this.storeOrderId;
	}

	public void setTid(String tid) {
		this.tid = tid;
	}

	public String getTid() {
		return this.tid;
	}

	public void setUtdid(String utdid) {
		this.utdid = utdid;
	}

	public String getUtdid() {
		return this.utdid;
	}

	public String getApiMethodName() {
		return "tmall.nr.pay.deduct";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("biz_identity", this.bizIdentity);
		txtParams.put("buyer_id", this.buyerId);
		txtParams.put("channel_code", this.channelCode);
		txtParams.put("current_transaction_id", this.currentTransactionId);
		txtParams.put("operator_id", this.operatorId);
		txtParams.put("pay_channel", this.payChannel);
		txtParams.put("pay_fee", this.payFee);
		txtParams.put("pay_time", this.payTime);
		txtParams.put("small_change", this.smallChange);
		txtParams.put("store_code", this.storeCode);
		txtParams.put("store_order_id", this.storeOrderId);
		txtParams.put("tid", this.tid);
		txtParams.put("utdid", this.utdid);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<TmallNrPayDeductResponse> getResponseClass() {
		return TmallNrPayDeductResponse.class;
	}

	public void check() throws ApiRuleException {
		RequestCheckUtils.checkNotEmpty(bizIdentity, "bizIdentity");
		RequestCheckUtils.checkNotEmpty(currentTransactionId, "currentTransactionId");
		RequestCheckUtils.checkNotEmpty(payChannel, "payChannel");
		RequestCheckUtils.checkNotEmpty(payFee, "payFee");
		RequestCheckUtils.checkNotEmpty(payTime, "payTime");
		RequestCheckUtils.checkNotEmpty(storeCode, "storeCode");
		RequestCheckUtils.checkNotEmpty(storeOrderId, "storeOrderId");
		RequestCheckUtils.checkNotEmpty(tid, "tid");
		RequestCheckUtils.checkNotEmpty(utdid, "utdid");
	}
	

}